package com.zhihuishu.micro.course.openapi.cc;

import java.util.List;

import com.zhihuishu.micro.course.openapi.cc.dto.ChapterWebDto;
import com.zhihuishu.remote.RemoteException;
import com.zhihuishu.remote.RemoteResult;

/**
 * 章节远程接口
 * @author      zhanglikun
 * @date        2015年10月29日 下午2:15:29
 */

public interface ChapterLessonOpenService {

    /**
     * 根据指定课程下章节基本信息列表(只包含ID、名称、Rank值)
     * 
     * @param courseId
     * @return
     * @throws RemoteException
     */
    RemoteResult<List<ChapterWebDto>> queryChapterBasicInfos(long courseId) throws RemoteException;

    // ================================================= 更新缓存接口
    // =======================================================

    /**
     * 更新章缓存(Redis)，用于创建、更新章接口
     * 
     * @param chapterId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> updateChapterRedis(int chapterId) throws RemoteException;

    /**
     * 更新节缓存(Redis)，用于创建、更新节接口
     * 
     * @param lessonId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> updateLessonRedis(int lessonId) throws RemoteException;

    /**
     * 更新小节缓存(Redis)，用于创建、更新小节接口
     * 
     * @param lessonVideoId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> updateLessonVideoRedis(int lessonVideoId) throws RemoteException;

    /**
     * 向课程添加章缓存(关系)
     * 
     * @param courseId
     * @param chapterId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> addChapterOnCourseRedis(long courseId, int chapterId) throws RemoteException;

    /**
     * @Description:向课程添加章缓存,无论是章是否完整
     * @date:@2016年12月6日下午4:52:42
     * @author:嵇鹏
     * @Param:
     * @retuen:RemoteResult<Void>
     */
    RemoteResult<Void> addChapterOnCourseRedisWithOutChecPassStatus(long courseId, int chapterId);

    /**
     * 从课程中移除章缓存(关系)
     * 
     * @param courseId
     * @param chapterId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> removeChapterOnCourseRedis(long courseId, int chapterId) throws RemoteException;
    
    /** @Description:从可冲中移除章缓存(关系)
     *  @date:@2016年12月6日下午4:56:33
     *  @author:嵇鹏
     *  @Param:
     *  @retuen:RemoteResult<Void>
     */
    RemoteResult<Void> removeChapterOnCourseRedisWithOutChecPassStatus(long courseId, int chapterId);

    /**
     * 向课程中添加节缓存(关系)
     * 
     * @param courseId
     * @param lessonId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> addLessonOnCourseRedis(long courseId, int lessonId) throws RemoteException;

    /**
     * 从课程中移除节缓存(关系)
     * 
     * @param courseId
     * @param lessonId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> removeLessonOnCourseRedis(long courseId, int lessonId) throws RemoteException;

    /**
     * 向课程中添加小节缓存(关系)
     * 
     * @param courseId
     * @param lessonVideoId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> addLessonVideoOnCourseRedis(long courseId, int lessonVideoId) throws RemoteException;

    /**
     * 从课程程中移除小节(关系)
     * 
     * @param courseId
     * @param lessonVideoId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> removeLessonVideoOnCourseRedis(long courseId, int lessonVideoId)
            throws RemoteException;

}
